package com.wrl.mmall.dao;

import com.wrl.mmall.pojo.Order;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface OrderMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    //查询订单是否存在
    Order selectByUserIdAndOrderNo(@Param("userId") Integer userId, @Param("orderNo") Long orderNo);
    //根据订单号，查询订单
    Order selectByOrderNo(@Param("orderNo") Long orderNo);
    //查询该用户的所有订单
    List<Order> selectByUserId(@Param("userId") Integer userId);
    //查询所有
    List<Order> selectAllOrOrder();

    //定时关单
    List<Order> closeOrder(@Param("status") Integer status, @Param("date") Date date);
    void closeOrderByOrderId(Integer id);
}